<script>
    //缩略图
    var thumbUploader = KindEditor.editor({
        allowFileManager : true,
        uploadJson       : '{:U('Attachment/uploadJson')}',            //更改默认的上传控件
        fileManagerJson  : '{:U('Attachment/fileManagerJson')}',  //更改默认的空间控件
    });
    function flashupload(uploadid, name, textareaid, funcName, args, module, catid, authkey){
        thumbUploader.loadPlugin('image', function() {
            thumbUploader.plugin.imageDialog({
                imageUrl : KindEditor('#'+textareaid).val(),
                clickFn : function(url, title, width, height, border, align) {
                    if(funcName){
                        funcName(uploadid,textareaid,url);
                    }else{

                    }
                    // KindEditor('#thumb').val(url);
                    // $('#thumb_preview').attr("src", url);
                    thumbUploader.hideDialog();
                }

            });
        });
    }
    function preview(uploadid,returnid, url){
        $('#'+returnid).val(url);
        $('#'+returnid+'_s').attr('src', url);
    }


</script>

<div class="bjui-pageContent">
    <form action="<empty name="Detail">{:U('Article/posterAdd')}<else />{:U('Article/posterEdit?id='.$Detail['id'])}</empty>" id="j_custom_form" data-toggle="validate" data-alertmsg="false">

        <div style="margin:15px auto 0;">
            <fieldset>
                <legend>基本信息</legend>
                <!-- Tab panes -->
                <div class="">
                    <div class="tab-pane fade active in" id="tab_setting_1">
                        <table class="table table-condensed table-hover" width="100%">
                            <tbody>
                                <tr>
                                    <td>
                                        <label for="c_name" class="control-label x85">标题：</label>
                                        <input type="text" id="c_name" name="info[name]" value="{$Detail.name}" data-rule="required" size="15" class="required">
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </fieldset>

            <fieldset>
                <legend>图片设置</legend>
                <!-- Tab panes -->
                <div class="">
                    <div class="tab-pane fade active in" id="tab_setting_2">
                        <for start="1" end="11">
                        <table width="100%"  class="table_form" style="border-bottom: 1px solid #ccc;margin: 15px 0px;">
                            <tbody>
                            <tr>
                                <th width="80"><?php echo L('linkurl')?>：</th>
                                <td class="y-bg"><input type="text" class="input-text" name="setting[images][<?php echo $i;?>][linkurl]" id="linkurl<?php echo $i;?>" size="30" value="<?php echo $Detail['setting'][$i]['linkurl']?>" /></td>
                                <td rowspan="2"><a href="javascript:flashupload('imgurl<?php echo $i;?>_images', '<?php echo L('upload_photo')?>','imgurl<?php echo $i;?>',preview,'1,<?php echo $this->M['ext']?>,1','poster', '', '<?php echo $authkey?>');void(0);"><img src="<?php echo $Detail['setting'][$i]['imageurl']?>" id="imgurl<?php echo $i;?>_s" width="105" height="88" onerror="this.src='/Public/images/nopic.gif'"></a><input type="hidden" id="imgurl<?php echo $i;?>" name="setting[images][<?php echo $i;?>][imageurl]" value="<?php echo $Detail['setting'][$i]['imageurl']?>"></td>
                            </tr>
                            <tr>
                                <th><?php echo L('alt')?>：</th>
                                <td class="y-bg"><input type="text" class="input-text" name="setting[images][<?php echo $i;?>][alt]" id="alt<?php echo $i;?>" value="<?php echo $Detail['setting'][$i]['alt']?>" size="30" /></td>
                            </tr>
                        </table>
                        </for>
                    </div>
                </div>
            </fieldset>
        </div>
        
    </form>
</div>
<div class="bjui-pageFooter">
    <ul>
        <li><button type="button" class="btn-close" data-icon="close">取消</button></li>
        <li><button type="submit" class="btn-default" data-icon="save">保存</button></li>
    </ul>
</div>